// import { axios } from '@/utils/request'
import mockjs from 'mockjs'

export function getChildren(parameter) {
    console.log(parameter)
    // return axios({
    //     url: '/child/page',
    //     method: 'get',
    //     params: parameter
    // })

    var temp = mockjs.mock({
        "code": 200,
        "data": {
            "current": parameter.pageIndex,
            "total": 99,
            "size": parameter.pageSize,
            "records|20": [{
                "childid": "@integer(10,1000)",
                "name": "某人",
                "idcardno": "@id",
                "status": "1",
                "parentName": "某家长",
                "mobile": "@mobile",
                "gmtCreate": "@date(yyyy-MM-dd)",
                "indexImgurl": "@image(200x200)",
                 "masterImgurl": "@image(200x200)",
                 "childImgurl": "@image(200x200)"
            }]
        },

    })
    return new Promise(function (resolve, reject) {
        //做一些异步操作
        setTimeout(function () {
            resolve(temp)
        }, 2000);
    });
}

export function updateChild(parameter) {
    // return axios({
    //     url: '/child/update',
    //     method: 'put',
    //     data: parameter
    // })
}

export function delChild(parameter) {
    // return axios({
    //     url: `/child/delete/${parameter}`,
    //     method: 'delete'
    // })
}